/*
 * @FileName: [RechargeCardTradeService.java] 
 * @Package com.bcinfo.iccard.service 
 * 
 * 
 * Copyright (c) 2011-2015 BCINFO Technology Limited Com.
 * All rights reserved.
 * 
 * This software is the confidential and proprietary 
 * information of BCINFO Technology Limited Company
 * ("Confidential Information"). You shall not disclose 
 * such Confidential Information and shall use it only
 * in accordance with the terms of the contract agreement 
 * you entered into with RKY.
 * 
 * $Rev: 554 $
 * $LastChangedDate: 2013-12-17 19:57:15 +0800 (Tue, 17 Dec 2013) $
 * $LastChangedBy: wanggc $
 * 
 * @category ICCARD
 * @version 1.1
 * @author $Author: wanggc $
 *
 * Change History:[Formatter: author date description] <br/>
 * 1
 * 2
 * 3
*/


package com.bcinfo.iccard.service;

import com.bcinfo.iccard.exception.IccardDatabaseException;
import com.bcinfo.iccard.model.ComboCardExpensiveRecordTemp;
import com.bcinfo.iccard.model.ComboCardSaleDetail;
import com.bcinfo.iccard.model.Pos;

/**
 * 套餐卡交易服务 <br/>
 * <p>Description:<br/>
 *    <p>TODO 提供套餐卡预消费、拨正、查询等方法
 *
 * <p>For Examples <br/>
 * <PRE>
 *      
 * </PRE>
 * <p>
 */
public interface ComboCardTradeService
{
    /**
     * 根据最后一笔正确流水号拨正失败交易
     *  <br/>
     * <p>Description: 修改该批失败交易状态由预交易为异常，并且将商品提取状态置为未提取
     * <br/>只针对指定的商家下的交易有效
     * <p>Author: wangguangchun<br/>
     * <p>Date: 2013-12-11-下午04:46:34<br/>
     * <p>
     * @param merchantCode 商家编码
     * @param serialNum 流水号
     * @return
     * @throws IccardDatabaseException   
     *
     */
    public void feedBackFailedTradeByMer(String merchantCode,String posCode,String serialNum) throws IccardDatabaseException;
    /**
     * 新增预交易
     * <br/>
     * <p>Description: 新交易来了之后先入预交易表
     * <br/>
     * <p>Author: wangguangchun<br/>
     * <p>Date: 2013-12-11-下午04:49:09<br/>
     * <p>
     * @param temp 预交易
     * @return
     * @throws IccardDatabaseException   
     *
     */
    public ComboCardExpensiveRecordTemp addTempExpensive(ComboCardExpensiveRecordTemp temp) throws IccardDatabaseException;
    /**
     * 
     * 更新预交易 <br/>
     * <p>Description: TODO(详细描述) 
     * <br/>
     * <p>Author: wangguangchun<br/>
     * <p>Date: 2013-12-11-下午05:02:24<br/>
     * <p>
     * @param temp 预交易
     * @return
     * @throws IccardDatabaseException   
     *
     */
    public int update(ComboCardExpensiveRecordTemp temp) throws IccardDatabaseException;
    /**
     * 
     * 根据二维码查询套餐卡销售明细 <br/>
     * <p>Description: TODO(详细描述) 
     * <br/>
     * <p>Author: wangguangchun<br/>
     * <p>Date: 2013-12-12-下午04:34:30<br/>
     * <p>
     * @param qrCode 二维码
     * @return
     * @throws IccardDatabaseException   
     *
     */
    public ComboCardSaleDetail loadByQrCode(String qrCode) throws IccardDatabaseException;
    
    /**
     * 
     * 按商家编码及二维码查询套餐卡预消费表 <br/>
     * <p>Description: TODO查询时携带商家编码、二维码、状态为非无效
     * <br/>
     * <p>Author: wangguangchun<br/>
     * <p>Date: 2013-12-12-下午05:28:05<br/>
     * <p>
     * @param merchantCode 商家信息
     * @param qrCode 二维码
     * @return
     * @throws IccardDatabaseException   
     *
     */
    public ComboCardExpensiveRecordTemp loadyByMerQrCode(String merchantCode,String qrCode) throws IccardDatabaseException;
    /**
     * 
     * 消费套餐卡<br/>
     * <p>Description:套餐卡交易 
     * <br/>
     * <p>Author: wangguangchun<br/>
     * <p>Date: 2013-12-12-下午06:10:37<br/>
     * <p>
     * @param temp 套餐卡预交易信息
     * @param pos POS机编码
     * @param qrCode 二维码
     * @throws IccardDatabaseException   
     *
     */
    public ComboCardExpensiveRecordTemp comboCardTrade(ComboCardExpensiveRecordTemp temp,Pos pos,String qrCode) throws IccardDatabaseException;
    
}
